<?php
/**
 * Created by PhpStorm.
 * User: Soha_Ros
 * Date: 17/6/10
 * Time: 下午1:50
 */

namespace ActionsHttp;


use Data\Table_dining_DAO;

class TableGetRecord extends BaseActionHttp
{
    public function doAction() {

        parent::doAction();

        // 商铺id
        $restaurant_id = $_SESSION[RESTAURANT_ID];
        $restaurant_id = 1;


        $table_id = $this->data[TABLE_ID];

        $table_record = Table_dining_DAO::getRecord($table_id);

        if (!$table_record) {
            return $this->SendErrMsg("没有该桌子");
        }

        if ($table_record->getRESTAURANT_ID() != $restaurant_id) {
            return $this->SendErrMsg("非法操作");
        }

        $this->setValue(Table_dining,$table_record->getArray());

        // 返回数据
        $this->ResponseDataToCurrentClient();

    }
}